import fetch from '@/utils/request';

import Index from './index.js'

/**
 * 门店订单对象
 * @module TenantOrder
 */
class TenantOrder extends Index {

	constructor(path, tenantPath) {
		super(path);
		this.tenantPath = tenantPath;
	};
	/**
	 * @function query
	 * @description 查询门店订单
	 * @param  {Object} query 查询参数对象
	 * @param  {Object} param 分页参数对象
	 */
	query = (query, param) => fetch.request({
		url: `${this.tenantPath}/query`,
		method: 'POST',
		data: {
			query: query,
			param: param
		},
	});
	/**
	 * @function check_off
	 * @description 门店核销
	 * @param  {String} checkOffNo
	 * @param  {String} tenantId
	 * @param  {String} storeId
	 */
	check_off = (query, param) => fetch.request({
		url: `${this.tenantPath}/check_off`,
		method: 'POST',
		data: {
			checkOffNo: checkOffNo,
			tenantId: tenantId,
			storeId: storeId,
		},
	});
}

export default new TenantOrder("/api/user/order", "/api/store/order");